# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.

defmodule GoogleApi.Spectrum.V1explorer.Model.PawsNotifySpectrumUseRequest do
  @moduledoc """
  The spectrum-use notification message which must contain the geolocation of the Device and parameters required by the regulatory domain.

  ## Attributes

  - deviceDesc (DeviceDescriptor): Device descriptor information is required in the spectrum-use notification message. Defaults to: `null`.
  - location (GeoLocation): The geolocation of the master device (the device that is sending the spectrum-use notification) to the database is required in the spectrum-use notification message. Defaults to: `null`.
  - spectra ([SpectrumMessage]): A spectrum list is required in the spectrum-use notification. The list specifies the spectrum that the device expects to use, which includes frequency ranges and maximum power levels. The list may be empty if the device decides not to use any of spectrum. For consistency, the psdBandwidthHz value should match that from one of the spectrum elements in the corresponding available spectrum response previously sent to the device by the database. Note that maximum power levels in the spectrum element must be expressed as power spectral density over the specified psdBandwidthHz value. The actual bandwidth to be used (as computed from the start and stop frequencies) may be different from the psdBandwidthHz value. As an example, when regulatory rules express maximum power spectral density in terms of maximum power over any 100 kHz band, then the psdBandwidthHz value should be set to 100 kHz, even though the actual bandwidth used can be 20 kHz. Defaults to: `null`.
  - type (String.t): The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...).  Required field. Defaults to: `null`.
  - version (String.t): The PAWS version. Must be exactly 1.0.  Required field. Defaults to: `null`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :deviceDesc => GoogleApi.Spectrum.V1explorer.Model.DeviceDescriptor.t(),
          :location => GoogleApi.Spectrum.V1explorer.Model.GeoLocation.t(),
          :spectra => list(GoogleApi.Spectrum.V1explorer.Model.SpectrumMessage.t()),
          :type => any(),
          :version => any()
        }

  field(:deviceDesc, as: GoogleApi.Spectrum.V1explorer.Model.DeviceDescriptor)
  field(:location, as: GoogleApi.Spectrum.V1explorer.Model.GeoLocation)
  field(:spectra, as: GoogleApi.Spectrum.V1explorer.Model.SpectrumMessage, type: :list)
  field(:type)
  field(:version)
end

defimpl Poison.Decoder, for: GoogleApi.Spectrum.V1explorer.Model.PawsNotifySpectrumUseRequest do
  def decode(value, options) do
    GoogleApi.Spectrum.V1explorer.Model.PawsNotifySpectrumUseRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Spectrum.V1explorer.Model.PawsNotifySpectrumUseRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
